<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>For...in</title>
</head>
<body>
    <script>
        var obj = {
            "name":"zhangsan","age":30
        }
        obj._proto_.sex = "male";
        //for in 遍历的是对象的所有可枚举类型
        for(var i in obj)
        {
            //属性名
            console.log(i);
            //obj[变量]
            console.log(obj[i]);
        }
        //遍历数组
        var arr = [0,1,2,3,4];
        for(var i in arr)
        {
            console.log(i);
            console.log(arr[i]);
        }
    </script>
</body>
</html>